<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>百度地图学习实例</title>
    <!--加载-->
    <meta name="viewport" content="initial-scale=1.0,user-scalable=no"/>
    <script src="http://api.map.baidu.com/api?v=2.0&ak=LXUjqYwEANG4k7ENttGPunwQUSMmSpnC" type="text/javascript"></script>
    <style>
        html {
            height: 100%;
        }
        body {
            height: 100%;
            margin: 0;
            padding: 0;
        }
        #container {
            height: 100%;
        }
    </style>
</head>
<body>
<div id="container"></div>
</body>
</html>
<script>
    var map = new BMap.Map("container");         // 创建地图实例
    var point = new BMap.Point(113.758652, 34.734857);  // 创建点坐标
    map.centerAndZoom(point, 15);                 // 初始化地图，设置中心点坐标和地图级别
    var traffic = new BMap.TrafficLayer();        // 创建交通流量图层实例
    map.addTileLayer(traffic);                    // 将图层添加到地图上
//搜索服务
    var map = new BMap.Map("container");
    map.centerAndZoom(new BMap.Point(116.404, 39.915), 11);
    var local = new BMap.LocalSearch(map, {
        renderOptions:{map: map}
    });
    local.search("世界之窗");
</script>